package eteam.aps.systeminterface.service;

import eteam.aps.common.QueryResult;
import eteam.aps.common.R;
import eteam.aps.common.exceptions.AuthException;
import eteam.aps.systeminterface.model.dto.EmpDto;
import eteam.aps.systeminterface.model.entity.EmpEntity;
import eteam.aps.systeminterface.model.reqparam.IdParam;
import eteam.aps.systeminterface.model.reqparam.QueryEmpParam;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 职员服务
 */
public interface IEmpController {
    /**
     * 分页查询职员信息
     *
     * @param requestDto: 查询参数
     * @return
     */
    @GetMapping(value = "/api/emp/querypagelist")
    R<QueryResult<EmpEntity>> queryEmpPageList(@Validated QueryEmpParam requestDto) throws Exception, AuthException;

    /**
     * 新增职员
     *
     * @param empDto: 职员信息
     * @return
     */
    @PostMapping(value = "/api/emp/createemp")
    R createEmp(@Validated(Insert.class) @RequestBody EmpDto empDto) throws Exception, AuthException;

    /**
     * 更新职员
     *
     * @param empDto: 职员信息
     * @return
     */
    @PostMapping(value = "/api/emp/updateemp")
    R updateEmp(@Validated(Update.class) @RequestBody EmpDto empDto) throws Exception, AuthException;

    /**
     * 删除职员
     *
     * @param empParam: 职员Id参数
     * @return
     */
    @PostMapping(value = "/api/emp/deleteemp")
    R deleteEmp(@Validated @RequestBody IdParam empParam) throws Exception, AuthException;
}
